package section2;

import section2.series.*; 
import jgfutil.*; 

public class SeriesTest{ 

  public static int nthreads;

  public static void main(String argv[]){


	nthreads = Integer.parseInt(argv[0]);
	int size = Integer.parseInt(argv[1]);
	System.out.println();
	JGFSeriesBench se = new JGFSeriesBench(nthreads); 
	float[][] res1 = se.getResult(size);
	JGFSeriesOCLBench se2 = new JGFSeriesOCLBench(nthreads); 
	float [][] res2 = se2.getResult(size);
	
	for (int i = 0; i<res1.length; i++)
		for (int j =0; j<res1[i].length;j++)
		{
 			double dev = Math.abs(res1[i][j] - res2[i][j]);
			if(dev > 1.0e-5)
			{
				System.out.println("Results not equal in row "+i+" column "+j+".");
				System.out.println("Original result: "+res1[i][j]+", ocl result: "+res2[i][j]);
			}
		}

  }
}
